﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SPI_TOOLS.Models
{
    public class PanelDataModel:ModelNotifyBase
    {
        public PanelDataModel() { }

        private string id = "";
        public string Id 
        { 
            get { return id; }
            set {  id = value; RaisePropertyChanged(nameof(Id)); }
        }

        private string barcode = "";
        public string Barcode
        {
            get { return barcode; }
            set { barcode = value; RaisePropertyChanged(nameof(Id)); }
        }

        private int state  = 0;
        public int State
        {
            get { return state; }
            set
            {
                state = value; RaisePropertyChanged(nameof(State));
            }
        }

        private int componentTotal = 0;
        public int ComponentTotal
        { get { return componentTotal; } set { componentTotal = value; RaisePropertyChanged( nameof(ComponentTotal)); } }

        private int alarmTotal = 0;
        public int AlarmTotal{ get { return alarmTotal; } set { alarmTotal = value; RaisePropertyChanged(nameof(AlarmTotal)); } }

        private int r_ok_Total = 0;
        public int R_ok_Total { get { return r_ok_Total; } set { r_ok_Total = value; RaisePropertyChanged(nameof(R_ok_Total)); } }

        private int r_ng_Total = 0;
        public int R_ng_Total { get { return r_ng_Total; } set { r_ng_Total = value; RaisePropertyChanged(nameof(R_ng_Total)); } }

        private DateTime create_time = DateTime.Now;
        public DateTime CreateTime { get { return create_time; } set { create_time = value; RaisePropertyChanged(nameof(CreateTime)); } }

        private DateTime confirm_time = DateTime.Now;
        public DateTime ConfirmTime { get { return confirm_time; } set { confirm_time = value; RaisePropertyChanged(nameof(ConfirmTime)); } }


        private string recipe_code = "default";
        public string RecipeCode { get { return recipe_code; } set { recipe_code = value; RaisePropertyChanged(nameof(RecipeCode)); } }

        private double width = 0;
        public double Width { get { return width; } set { width = value; RaisePropertyChanged(nameof(Width)); } }

        private double height = 0;
        public double Height { get { return height; } set { height = value; RaisePropertyChanged(nameof(Height)); } }

        //
        private ObservableCollection<BoardDataModel> boards = new ObservableCollection<BoardDataModel>();
        public ObservableCollection<BoardDataModel> Boards
        {
            get { return boards; }
        }

        public void AddBoard(BoardDataModel board)
        {
            boards.Add(board);
        }
    }
}
